﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace PRE.Thongke_Baocao
{
    public partial class FrmPhieukhamtheotrangthaikham : DevExpress.XtraEditors.XtraForm
    {
        DAL.PhieukhamtheotrangthaikhamDAL _dal = new DAL.PhieukhamtheotrangthaikhamDAL();
        public FrmPhieukhamtheotrangthaikham()
        {
            InitializeComponent();
        }

        private void FrmPhieukhamtheotrangthaikham_Load(object sender, EventArgs e)
        {
            cboMATRANGTHAI.Properties.DataSource = _dal.select_trangthaikham();
            string id = (cboMATRANGTHAI.EditValue + "").Trim();
          
            DataTable _dtb = _dal.Phieukhamtheotrangthai(id);


            if (_dtb != null)
            {
                grcMain.DataSource = _dtb;
            }

        }
     

        private void cboMATRANGTHAI_EditValueChanged_1(object sender, EventArgs e)
        {
            string id = (cboMATRANGTHAI.EditValue + "").Trim();
            DataTable _dtb = _dal.Phieukhamtheotrangthai(id);


            if (_dtb != null)
            {
                grcMain.DataSource = _dtb;
            }
        }

        private void Thoát_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            string matrangthai =cboMATRANGTHAI.EditValue+ "";
            DataTable dtb_report = _dal.Phieukhamtheotrangthai(matrangthai);

            var frm = new Report.Report_Base();
            var xr = new Report.XRTKphieukham();

            xr.DataSource = dtb_report;
            frm.SetReport(xr);

            frm.Show();
        }

        private void labelControl3_Click(object sender, EventArgs e)
        {

        }
    }
}